package bd;

import java.sql.Connection;
import java.sql.DriverManager;
import javax.swing.JOptionPane;

/**
 *
 * @author LAB4-PC01
 */
public abstract class Factory {
    
    public static Connection getConnection() {
        try {
            Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance();
            return DriverManager.getConnection("jdbc:derby://localhost:1527/usuario", "ufpa", "ufpa");
        } catch (Exception e) {
            JOptionPane.showMessageDialog(null, "Erro ao tentar se conectar com\no Banco de Dados!","Aviso do Sistema",JOptionPane.WARNING_MESSAGE);
            System.exit(-1);
            return null;
        }
    }
}
